package cn.micai.base.concurrent;

/**
 * @Auther: zhaoxinguo
 * @Date: 2018/7/5 16:42
 * @Description: 使用私有锁保护状态的类
 */
public class PrivateLock {

    private final Object myLock = new Object();

    Widget widget;

    void someMethod() {
        synchronized (myLock) {
            // 访问或修改Widget的状态

        }
    }


}
